package com.authine.cloudpivot.ext.service;


import com.alibaba.cola.dto.SingleResponse;
import com.authine.cloudpivot.ext.dto.voucher.Voucher;
import com.authine.cloudpivot.ext.kingdee.work.VoucherWork;
import lombok.extern.slf4j.Slf4j;
import org.springframework.util.Assert;
import org.springframework.util.CollectionUtils;

import java.util.List;


@Slf4j
public class VoucherService  {

    private VoucherWork voucherWork = new VoucherWork();

    // 单表查询 云枢支持
//    @Path("pageVoucher")
//    @POST
//    @Operation(summary = "查询凭证表",tags = CUSTOM_SERVICE)
//    public SingleResponse<List<Voucher>> pageVoucher(@RequestBody VoucherQuery query){
//
//        return  null;
//    }



    public SingleResponse<List<Voucher>> listVoucher( String time){
        Assert.notNull(time, "根据月份查询凭证表 入参数据为空");

        return  voucherWork.listVoucher(time);
    }



    public SingleResponse<Integer> pushVoucher( List<Voucher> voucher){
        Assert.isTrue(!CollectionUtils.isEmpty(voucher), "生成凭证-K3 入参数据为空");

        return voucherWork.pushVoucher(voucher);
    }
}
